<?php
class LyAction {
	/**
	 * 
	 * @var LyContext
	 */
	public $context;
	protected $options = array();
	protected $viewData = array();
	function setOptions($options){
		$this->options = array_merge($this->options,$options);
	}
	function setContext($context){
		if($context instanceof LyContext){
			$this->context = $context;
		}
	}
	function beforeExecute(){
	
	}
	function run(){
		$this->beforeExecute();
		$this->execute();
	}
//	function render($tpl = null){
//		if(isset($this->context->getParams('ajax'))){
//			echo json_encode($this->viewData);
//		}else{
//			$view  = Lyd::app()->signton('LyView');
//			$view->data = $this->viewData;
//			$view->context = $this->context;
//			if(null == $tpl){
//				
//			}
//			$view->render($tpl);
//			
//		}
//	}
}